/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Sample UML2 to C++ generation
 *
 * Copyright (c) 2013 Alexander Diemand
 * All rights reserved.
 *
 * Author:     Alexander Diemand
 * Address:    Outerspace
 * Project:    Sample UML2 to C++ generation
 *
 * UML2 to C++ 
 * In easy steps from UML2 modeling to C++ coding.
 * What already works:
 * i)   generation of source and headers for enums and classes
 * ii)  the latter are: datatypes, interfaces and standard classes
 * iii) inherited static operations
 * iv)  isLeaf -> final, isReadOnly/isQuery -> const
 * What needs some work:
 * i)   templates are not yet supported
 * ii)  testing testing testing
 *
 * Repository: tbd
 * Generated:  2013-03-23 16:59:02
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */


#include "dataModel/DataContainer.hpp"
// Start of user code for includes
#include <string>
// End of user code

/**
 * @generated with Eclipse/Acceleo
 *  
 */

namespace dataModel
{

// Start of user code implementation of constructors/destructor


// CTOR
DataContainer::DataContainer(
	  const std::string &p_Addr
	, const std::string &p_City
	, const std::string &p_Name
	, const int p_Zip
	)
	: addr(p_Addr)
	, city(p_City)
	, name(p_Name)
	, zip(p_Zip)
{ }

// DTOR
DataContainer::~DataContainer()
{ }

DataContainer::DataContainer(const DataContainer &_o)
: addr(_o.addr)
, city(_o.city)
, commParams(_o.commParams)
, name(_o.name)
, revenue(_o.revenue)
, zip(_o.zip)
{ }

DataContainer & DataContainer::operator=(const DataContainer &_o)
{
 	this->commParams = _o.commParams;
 	this->revenue = _o.revenue;
	return *this;
}

bool DataContainer::operator==(const DataContainer &_o) const
{
	bool res = false;
	res = (this->addr==_o.addr);
	if (! res) return res;
	res = (this->city==_o.city);
	if (! res) return res;
	res = (this->commParams==_o.commParams);
	if (! res) return res;
	res = (this->name==_o.name);
	if (! res) return res;
	res = (this->revenue==_o.revenue);
	if (! res) return res;
	res = (this->zip==_o.zip);
	if (! res) return res;
	return true;
}

void DataContainer::swap(DataContainer &_o) throw()
{
	std::swap(this->commParams, _o.commParams);
	double _t_revenue = this->revenue;
 	this->revenue = _o.revenue;
	_o.revenue = _t_revenue;
}

// End of user code

// * * * *  O P E R A T I O N S  * * * *

/**
 * The method getRevenue.
 * 
 * @return double
 * 
 * @generated
 */
double DataContainer::getRevenue() 
{
	// Start of user code for the body of DataContainer::getRevenue
	// TODO should be implemented
	return revenue;
	// End of user code
}

/**
 * The method addSale.
 * 
 * @param amt
 * 
 * @generated
 */
void DataContainer::addSale(const double  amt) 
{
	// Start of user code for the body of DataContainer::addSale
	// TODO should be implemented
	revenue += amt;
	// End of user code
}



// * * * *  A C C E S S O R S  * * * *
/**
 * The getter getCity.
 * @generated
 */
std::string DataContainer::getCity() const
{
	return this->city;
}

/**
 * The getter getCommParams.
 * @generated
 */
CommParams DataContainer::getCommParams() const
{
	return this->commParams;
}

/**
 * The setter setCommParams.
 * @generated
 */
void DataContainer::setCommParams(const CommParams &p_CommParams) 
{
	this->commParams = p_CommParams;
}

/**
 * The getter getName.
 * @generated
 */
std::string DataContainer::getName() const
{
	return this->name;
}

/**
 * The getter getZip.
 * @generated
 */
int DataContainer::getZip() const
{
	return this->zip;
}

/**
 * The getter getAddr.
 * @generated
 */
std::string DataContainer::getAddr() const
{
	return this->addr;
}




void swap (DataContainer & o1, DataContainer & o2) throw ()
{
	o1.swap (o2);
}

} // namespace dataModel

namespace std {
	template <>
  	void swap (dataModel::DataContainer & o1, dataModel::DataContainer & o2) throw ()
  	{
  		o1.swap (o2);
	}
} // in std

